package com.ctshk.rpc.system.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ctshk.rpc.system.dto.CatalogMainDataDTO;
import com.ctshk.rpc.system.entity.MainDataTourGroup;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;


/**
 * <p>
 * 旅游组别表 Mapper 接口
 * </p>
 *
 * @author 谢诗宏
 * @since 2021-01-30
 */
public interface MainDataTourGroupMapper extends BaseMapper<MainDataTourGroup> {

    /**
     * @return
     */
    @Select({
            "SELECT tgc.tour_group_code,tgc.tour_group_name,tg.id AS region_id,tg.region_group AS region_name,tga.area_id,tga.area_name ",
            "FROM t_main_data_tour_group_area tga, ",
            "t_main_data_tour_group_code tgc, ",
            "t_main_data_tour_group tg ",
            "WHERE tgc.tour_group_code = tg.tour_group_code ",
            "and tga.code_id = tg.id ",
            "and tg.is_deleted = #{isDelete} ",
            "and tga.is_deleted = #{isDelete} ",
            "and tgc.is_deleted = #{isDelete} ",
            "and tg.status = #{status} ",
            "and tgc.status = #{status} "
    })
    List<CatalogMainDataDTO> queryCatalogMainData(@Param("isDelete") Integer isDelete, @Param("status") Integer status);
}
